package com.blog.controller.admin;

import com.blog.pojo.Category;
import com.blog.response.ResponseResult;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 分类的控制器
 * @Author XiaoLin
 * @Date 2021/2/26 10:28
 */
@RestController
@RequestMapping("/admin/category")
public class CategoryController {

  /**
      * @Description:添加分类
      * @author XiaoLin
      * @date 2021/2/26
      * @Param: [category]
      * @return com.blog.response.ResponseResult
      */
  @PostMapping()
  public ResponseResult addCategory(@RequestBody Category category){
    return null;
  }

  /**
      * @Description:删除分类
      * @author XiaoLin
      * @date 2021/2/26
      * @Param: [id]
      * @return com.blog.response.ResponseResult
      */
  @DeleteMapping("/{id}")
  public ResponseResult deleteCategory(@PathVariable("id") String id){
    return null;
  }

  /**
      * @Description:修改分类
      * @author XiaoLin
      * @date 2021/2/26
      * @Param: [id]
      * @return com.blog.response.ResponseResult
      */
  @PutMapping("/{id}")
  public ResponseResult updateCategory(@PathVariable("id") String id){
    return null;
  }

  /**
      * @Description:根据id查询
      * @author XiaoLin
      * @date 2021/2/26
      * @Param: [id]
      * @return com.blog.response.ResponseResult
      */
  @GetMapping("/{id}")
  public ResponseResult getCategory(@PathVariable("id") String id){
    return null;
  }

  /**
      * @Description:查询所有
      * @author XiaoLin
      * @date 2021/2/26
      * @Param: [currentPage, pageSize]
      * @return com.blog.response.ResponseResult
      */
  @GetMapping("/list")
  public ResponseResult listCategories(@RequestParam("currentPage") Integer currentPage,@RequestParam("pageSize") Integer pageSize){
    return null;
  }
}
